@import "../../styles/variables";
@import "../../styles/mixins";

.table table {
  width: 100%;
  text-align: left;

  & > thead {
    & > tr > th {
      padding: 16px 12px;
      @include TypographySymbolText;
      color: $dark-color01;

      a {
        color: $dark-color01;
      }

      &[colspan] {
        padding: 8px 12px;
        text-align: center;
        background-color: $secondary-bg-color;
      }

      .is-trigger {
        cursor: pointer;

        & > span {
          display: inline-block;
          vertical-align: middle;

          & + span {
            margin-left: 4px;
          }
        }
      }

      .icon > svg {
        color: $dark-color01;
      }
    }

    & > tr:not(:first-of-type) {
      label.checkbox {
        display: none;
      }

      & > th {
        padding: 8px 12px;
      }
    }
  }

  & > tbody {
    & > tr {
      & > td {
        height: 56px;
        padding: 8px 12px;
        border-top: 1px solid $light-color02;
        @include TypographyParagraph($dark-color07);
        word-break: break-all;
        box-sizing: border-box;

        &:first-child {
          border-left: 1px solid transparent;
        }
      }

      &:hover {
        & > td {
          background-color: $bg-color;

          a {
            color: $primary;
          }
        }
      }

      &:last-child {
        & > td {
          border-bottom: 1px solid $light-color02;
        }

        &.table-row-selected > td {
          border-bottom: 1px solid $primary;
        }
      }

      &.table-row-selected > td {
        border-top: 1px solid $primary;
        background-color: $bg-color;

        &:first-child {
          border-left: 1px solid $primary;
        }

        &:last-child {
          border-right: 1px solid $primary;
        }
      }
    }

    .table-row-selected + tr {
      & > td {
        border-top: 1px solid $primary;
      }
    }

    .table-row-selected + .table-row-selected {
      & > td {
        border-top: 1px solid transparent;
      }
    }
  }
}

.table-title {
  position: relative;
  padding: 10px 20px;
  background-color: $secondary-bg-color;
  box-shadow: 0 1px 0 0 $light-color02;
  border-top-left-radius: $border-radius;
  border-top-right-radius: $border-radius;
}

.table-placeholder {
  position: relative;
  padding: 16px;
  background: $white;
  text-align: center;
  z-index: 1;
}

.table-footer {
  position: relative;
  padding: 10px 20px;
  background-color: $secondary-bg-color;
  border-bottom-left-radius: $border-radius;
  border-bottom-right-radius: $border-radius;
  color: $dark-color01;
}

.table-has-selected > .table-title {
  background-color: $heading-color;
}

.table.table-multi-heads table > thead > tr {
  & > th {
    border-right: 1px solid $light-color02;
  }

  & + tr > th {
    border-top: 1px solid $light-color02;
  }
}
